
* EUROPEAN JOURNAL OF POLITICAL RESEARH *
* Citizens' Issue Priorities Respond to National Conditions, Less So to Parties' Issue Emphases *
* Henrik Bech Seeberg and James Adams *
* 10 July 2024 *

* REPLICATION FILE *
* The replication file has two parts. The first part uses data on * PARTY K's ATTENTION *. The second part uses data on * PARTY SYSTEM ATTENTION *

* PART 1
* PARTY K's ATTENTION *
use "replication file 1.dta", clear

*******************************************************************************************

* Variables from Model 2 in the manuscript: 

* ∆party k's supporters' attention to issue area j (t): d.mip
* b2 [party k's supporters' attention to issue area j (t – 1)]: l.mip
* b3 [party k's attention to issue area j (t – 1)]: l.CMP_emp
* b4 [∆party k's attention to issue area j (t)]: d.CMP_emp
* b5 [attention of all parties except k to issue area j (t – 1)]: l.CMP_emp_mean_excl 
* b6 [∆attention of all parties except k to issue area j (t)]: d.CMP_emp_mean_excl
* b7 [national conditions in issue area j (t – 1)]: l.RWP
* b8 [∆national conditions in issue area j (t)]: d.RWP
* Fixed effects at the issue level: i.issue
* Fixed effects at the party level: i.party_id
* Fixed effects at the country level: i.country
* Year variable: c.year

* Extra variables for robustness check:

* MIP questionnaire before or after the election: prepost 
* Length of time that had elapsed since the previous election: month_distance
* answer format closed- or open-ended: closed_MIP
* `most important problem' vs `most important issue': problem_MIP 
* media issue attention: media_att
* alternative national condition measures: RWP_alternative

*******************************************************************************************

* Table 2.
by issue, sort: xtsum CMP_emp mip RWP if CMP_emp !=. & mip != .
xtsum CMP_emp mip RWP if mip != . & RWP != .

* Figure 2.
xtset panel time // the panel variable allocates one number country-issue-party panel. the time variable allocates on number per year-observation within the panel. 
xtreg d.mip l.mip l.CMP_emp d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
coefplot, keep(*.CMP_emp *.CMP_emp_mean_excl *.RWP) ///
	xtitle(∆Party k's supporters' attention to issue area j (t)) ///
	omitted baselevels headings(L.CMP_emp = "{bf:Party k's att. to issue j}" ///
								L.CMP_emp_mean_excl = "{bf:Att. of all parties except k}" ///
								L.RWP = "{bf:National conditions to issue j}") ///
	coeflabel(L.CMP_emp = "(b3) level" ///
			  D.CMP_emp = "(b4) change" ///
			  L.CMP_emp_mean_excl = "(b5) level" ///
			  D.CMP_emp_mean_excl = "(b6) change" ///
			  L.RWP = "(b7) level" ///
			  D.RWP = "(b8) change") 

* Table A5. 
g d_mip = d.mip
g l_mip = l.mip
g d_CMP_emp = d.CMP_emp
g l_CMP_emp = l.CMP_emp
g d_RWP = d.RWP
g l_RWP = l.RWP
g l_CMP_emp_mean_excl = l.CMP_emp_mean_excl 
g d_CMP_emp_mean_excl = d.CMP_emp_mean_excl 
eivreg d_mip l_mip l_CMP_emp d_CMP_emp l_CMP_emp_mean_excl c.d_CMP_emp_mean_excl l_RWP d_RWP i.country i.issue i.party_id c.year, reliab(l_RWP  1 d_RWP  1 l_CMP_emp  1 d_CMP_emp 1)
eivreg d_mip l_mip l_CMP_emp d_CMP_emp l_CMP_emp_mean_excl c.d_CMP_emp_mean_excl l_RWP d_RWP i.country i.issue i.party_id c.year, reliab(l_RWP .9 d_RWP .9 l_CMP_emp .9 d_CMP_emp .9)
eivreg d_mip l_mip l_CMP_emp d_CMP_emp l_CMP_emp_mean_excl c.d_CMP_emp_mean_excl l_RWP d_RWP i.country i.issue i.party_id c.year, reliab(l_RWP .8 d_RWP .8 l_CMP_emp .8 d_CMP_emp .8)

* Table A7. 
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 1, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 103, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 6, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 7, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 230, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 12, re vce(r)
xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if issue != 13, re vce(r)

* Table A8.
xtreg d.mip prepost 		l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.mip month_distance	l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.mip closed_MIP		l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.mip problem_MIP		l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
				xtreg d.mip l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year if problem_MIP != 1, re vce(r)
xtreg d.mip media_att		l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.mip 				l.mip c.l.CMP_emp c.d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP_alternative d.RWP_alternative i.country i.issue i.party_id c.year, re vce(r)

* Table A10.
xtreg d.mip l.mip l.CMP_emp d.CMP_emp l.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)

* Table A11.
xtreg d.mip l.mip l2.mip l.CMP_emp l2.CMP_emp d.CMP_emp l.CMP_emp_mean_excl l2.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)
xtreg d.CMP_emp l.CMP_emp l2.CMP_emp l.mip l2.mip d.mip l.CMP_emp_mean_excl l2.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year, re vce(r)

	* Wald test 
	reg d.mip l.mip l2.mip l.CMP_emp l2.CMP_emp d.CMP_emp l.CMP_emp_mean_excl l2.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year
	est sto model1
	reg d.CMP_emp l.CMP_emp l2.CMP_emp l.mip l2.mip d.mip l.CMP_emp_mean_excl l2.CMP_emp_mean_excl c.d.CMP_emp_mean_excl l.RWP d.RWP i.country i.issue i.party_id c.year
	est sto model2
	suest model1 model2, vce(robust)
	test l.CMP_emp = l.mip

	
**************************************
**************************************
**************************************
**************************************
* PART 2
* PARTY SYSTEM ATTENTION *

**
use "replication file 2.dta", clear

**************************************************************

* Variables from Model 1 in the manuscript: 

* ∆party k's supporters' attention to issue area j (t): d.mip
* b2 [public attention to issue area j (t – 1)]: l.mip
* b3 [party system attention to issue area j (t – 1)]: l.CMP
* b4 [∆party system attention to issue area j (t)]: d.CMP
* b5 [national conditions in issue area j (t – 1)]: l.RWP
* b6 [∆national conditions in issue area j (t)]: d.RWP
* Fixed effects at the issue level: i.issue
* Fixed effects at the country level: i.country
* Year variable: c.year

**************************************************************

* Figure 1.
quietly xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country, re
coefplot, keep(*.CMP *.RWP) ///
	xtitle(∆Public attention to issue area j (t)) ///
	omitted baselevels headings(L.CMP = "{bf:Party system att. to issue j}" ///
								L.RWP = "{bf:National conditions to issue j}") ///
	coeflabel(L.CMP = "(b3) level" ///
			  D.CMP = "(b4) change" ///
			  L.RWP = "(b5) level" ///
			  D.RWP = "(b6) change") 

* Table A2.
xtreg D.mip L.mip L.CMP_emp D.CMP_emp l.RWP d.RWP c.year i.issue i.country, re

* Table A4.
g d_mip = d.mip
g l_mip = l.mip
g d_CMP = d.CMP
g l_CMP = l.CMP
g d_RWP = d.RWP
g l_RWP = l.RWP
eivreg d_mip l_mip l_CMP d_CMP l_RWP d_RWP c.year i.issue i.country, reliab(l_RWP  1 d_RWP  1 l_CMP  1 d_CMP 1)
eivreg d_mip l_mip l_CMP d_CMP l_RWP d_RWP c.year i.issue i.country, reliab(l_RWP .9 d_RWP .9 l_CMP .9 d_CMP .9)
eivreg d_mip l_mip l_CMP d_CMP l_RWP d_RWP c.year i.issue i.country, reliab(l_RWP .8 d_RWP .8 l_CMP .8 d_CMP .8)

* Table A6.
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country, re 
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 1, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 103, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 6, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 7, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 9, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 12, re
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country if issue != 13, re

* Table A9.
xtreg D.mip L.mip L.CMP D.CMP l.RWP d.RWP c.year i.issue i.country, re
